﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Themes/Default/Views/Shared/Admin.Master" Inherits="System.Web.Mvc.ViewPage<Fashion.ViewModels.ProductDetailViewModel>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="Submenu" runat="server">
<div id="top-panel">
            <div id="panel">
                <ul>
            		<li><a href="../Admin/AddProduct" class="product">Add New product</a></li>
                </ul>
            </div>
    </div>
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
     <h2>All Products</h2>

    <table>
        <tr>
            <th></th>
            <th>
                ProductID
            </th>
            <th>
                Product Name
            </th>
            <th>
                CategoryID
            </th>
            <th>
                BrandID
            </th>
            <th>
                Price
            </th>
            <th>
                Rating
            </th>
            <th>
                Likes
            </th>
            <th> 
                Date Added
            </th>
            <th>
                Image List
            </th>
        </tr>

    <% foreach (var item in Model.ProductList) { %>
    
        <tr>
            <td>
                <%: Html.ActionLink("Edit", "EditProduct", new { pid=item.ProductID })%>
            </td>
            <td>
                <%: item.ProductID %>
            </td>
            <td>
                <%: item.ProductName %>
            </td>
            <td>
                <%: item.CategoryID %>
            </td>
            <td>
                <%: item.BrandID %>
            </td>
            <td>
                <%: String.Format("{0:F}", item.Price) %>
            </td>
            <td>
                <%: String.Format("{0:F}", item.Rating) %>
            </td>
            <td>
                <%: item.Likes %>
            </td>
            <td>
                <%: String.Format("{0:dd/MM/yyyy}", item.DateAdded)%>
            </td>
            <td>
                <%: item.ImageList.ToString() %>
            </td>
        </tr>
    
    <% } %>

    </table>
    <% if ((string)ViewData["pageLinks"] != "")
           { %>
           <%= ViewData["pageLinks"] %>
           <br /><br />
    <% } %>      
    <p>
        <%: Html.ActionLink("Back to Dashboard", "Index") %>
    </p>
</asp:Content>
